const low = require('lowdb')
const FileSync = require('lowdb/adapters/FileSync')

const dataBaseDir = 'E:/code/electron/parts-man/src/data/'

const parts = low(new FileSync(dataBaseDir + 'part.json'))

for (let i = 1; i < 25; i++) {
    let part = {
        'id': i,
        'nameCn': '测速传感器 ' + i,
        'nameEn': 'SENSOR',
        'pageNumber': 220,
        'serialNumber': '220.029',
        'modelNumber': 'M8x15',
        'weight': '5G',
        'partNumber1': '10530381',
        'partNumber2': 'xs010',
    }
    parts.push(part).write()
    i++
    let part1 = {
        'id': i,
        'nameCn': '断纱传感器 ' + i,
        'nameEn': 'SENSOR',
        'pageNumber': 378,
        'serialNumber': '378.001',
        'modelNumber': '30X50X8',
        'weight': '50G',
        'partNumber1': '10430745',
        'partNumber2': 'xs008',
    }
    parts.push(part1).write()
}
